<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta http-equiv="X-UA-Compatible" content="IE=8">
		<title>招生计划--人气排行榜 </title>
		<!--<link href="../favicon.ico" rel="icon" type="image/x-icon" />-->
		<link rel="stylesheet" href="../../bootstrap/css/bootstrap.min.css">
		<link rel="stylesheet" href="../../layui/css/layui.css">
		<link rel="stylesheet" href="../../css/swiper.min.css">
		<link rel="stylesheet" href="../../css/common.css">
		<link rel="stylesheet" href="../../css/default.css">
		<link rel="stylesheet" href="../../css/style.css">

		<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
		<!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js?version=1.01"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js?version=1.01"></script>
    <![endif]-->

	</head>

	<body>
		<div class="top_header_wrap"></div>
		<!--#include file="../common/header.html" -->
		<!--广告-->
		<div class="banner">
			<div class="swiper-container swiper-container1">
				<div class="swiper-wrapper">
					<div class="swiper-slide"><img src="../../img/banner.jpg"></div>
					<div class="swiper-slide"><img src="../../img/banner.jpg"></div>
					<div class="swiper-slide"><img src="../../img/banner.jpg"></div>
				</div>
				<!-- Add Pagination -->
				<div class="swiper-pagination"></div>
			</div>
		</div>
		<!--内容-->
		<div class="main_container">
			<div class="layui-container">
				<div class="brumb_box">
					<a href="entrance_programs.html">招生计划</a>&gt;<a href="ranking_specialty.html">2019年贫困专项招生计划</a>
				</div>
				<div class="module_box module_box_new">
					<div class="table_row">
						<div class="table-responsive">
							<table class="table table_mar specialty_img">
								<tbody id="speciaty_table">
									<tr>
										<td scope="row">
											<a href="university_VR.html"><img src="../../img/school_logo.png">西安邮电大学</a>
										</td>
									</tr>
									<!--<tr>
									<td scope="row"><img src="../../img/school_logo.png">西安邮电大学</td>
									<td><img src="../../img/school_logo.png">北京航天航空科技大学</td>
									<td><img src="../../img/school_logo.png">陕西电子科技大学</td>
								</tr>
								<tr>
									<td scope="row"><img src="../../img/school_logo.png">西安邮电大学</td>
									<td><img src="../../img/school_logo.png">北京航天航空科技大学</td>
									<td><img src="../../img/school_logo.png">陕西电子科技大学</td>
								</tr>-->
								</tbody>
							</table>
							<div id="page" class="pagnition">
							<ul class="clearfix">
								<li class="before_btn"></li>
								<li>
									<a href="javascript:void(0);"><i class="before_dot">.....</i></a>
								</li>
								<li>
									<a id='currPage0' href="javascript:void(0);" class="speifyPage active">1</a>
								</li>
								<li>
									<a id='currPage' href="javascript:void(0);" class="speifyPage">2</a>
								</li>
								<li>
									<a id='currPage1' href="javascript:void(0);" class="speifyPage">3</a>
								</li>
								<li>
									<a href="javascript:void(0);"><i class="after_dot">.....</i></a>
								</li>
								<li class="after_btn">

								</li>
							</ul>
						</div>
						</div>
					</div>
				</div>

			</div>
		</div>
		<!--尾部-->
		<div class="footer_container">

		</div>
		</div>
	</body>
	<script type="text/javascript" src="../../js/jquery-1.11.0.min.js"></script>
	<script type="text/javascript" src="../../js/define.js"></script>
	<script type="text/javascript" src="../../js/swiper.min.js"></script>
	<script type="text/javascript" src="../../js/swiper.js"></script>
	<script type="text/javascript" src="../../bootstrap/js/bootstrap.min.js"></script>
	<script>
		var currPage = 1;
		var totalPage = 1;

		function getData(thisPage) {
			$.ajax({
				type: "get",
				url: "http://47.111.188.27:8080/gsgkzyl/special/findSpecialSchool/" + thisPage + "/12",
				success: function(spn) {
					$('#speciaty_table').empty();
					var data = spn.data.list;
					if(data != null && data != "" && data != "{}" && data != "[]") {
						var speciatyHtml = "";
						for(var i = 0; i < data.length; i+=3) {
							speciatyHtml += '<tr>';
							for(var j =0; j < 3; j++){
								if((i+j) < data.length){
									speciatyHtml += '<td>';
									speciatyHtml += '<a href="'+data[i+j].school_link+'"><img src="'+data[i+j].school_logo+'">'+data[i+j].school_name+'</a>';
									speciatyHtml += '</td>';
								}
							}
							speciatyHtml += '</tr>';
						}
						$('#speciaty_table').html(speciatyHtml);
						
						totalPage=spn.data.totalPage;
						currPage=spn.data.currPage;
						
						/*分页逻辑*/
						$('.before_dot').hide();
						$('.after_dot').hide();
						if(currPage > 2) {
							$('.before_dot').show();
						}
						if(currPage <= totalPage - 2) {
							$('.after_dot').show();
						}

						$('.speifyPage').removeClass('active');
						var html = "";
						if(currPage > 1) {
							$("#currPage0").html(currPage - 1);
						} else {
							$("#currPage0").html(currPage);
							$("#currPage0").addClass("active")
							if(totalPage >= 2) {
								$("#currPage").html(currPage + 1);
							}
							if(totalPage >= 3) {
								$("#currPage1").html(currPage + 2);
							}
							return;
						}
						$("#currPage").html(currPage);
						$("#currPage").addClass("active");
						if(currPage < totalPage) {
							$("#currPage1").html(currPage + 1);
						} else {
							$('.speifyPage').removeClass('active');
							$("#currPage1").html(currPage);
							$("#currPage1").addClass("active")
							if(totalPage >= 2) {
								$("#currPage").html(currPage - 1);
							}
							if(totalPage >= 3) {
								$("#currPage0").html(currPage - 2);
							}
						}
					/*分页逻辑结束*/
					}else{
						$('#speciaty_table').html('暂无数据');
						$('.pagnition').hide();
					}
				}
			})
		}

		$(document).ready(function() {

			$(".top_header_wrap").load("../common/header.html");
			$(".footer_container").load("../common/footer.html");

			getData(1);

			$(".before_btn").click(function() {
				if(currPage == 1)
					return;
				getData(currPage - 1);
			})
			$(".after_btn").click(function() {
				if(currPage == totalPage)
					return;
				getData(currPage + 1);
			})
			$(".speifyPage").click(function() {
				var index = $(this).html();
				getData(index);
			})

		});
	</script>

</html>